A network element can use policy-based routing (PBR) to make routing decisions based on policies set by the network administrator. When a network element receives a packet, the network element normally decides where to forward the packet based on the destination address in the packet, which is then used to look up an entry in a routing table. However, in some cases, there may be a need to forward the packet based on other criteria. For example, a network administrator might want to forward a packet based on the source address, the port the packet was received on, type of service and/or some other packet characteristic. Policy-based routing may also be based on the size of the packet, the protocol of the payload, or other information available in a packet header or payload. This permits routing of packets originating from different sources to different networks even when the destinations are the same and can be useful when interconnecting several private networks. Each different type of policy-based routing is mapped to a policy map.
The network element will store routing tables for different policy maps in different tables. Using separate tables for each of the different policy maps can lead to an inefficient use of the network element memory.